package com.hjc.mapper;

import com.hjc.entity.Role;
import com.hjc.page.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper
{
    public List<Role> findAllRole();

    public int deleteRoleByUserId(Integer userId);

    public int findRoleIdByRoleName(String roleName);

    public int insertUserRole(Integer userId, Integer roleId);

    public Integer findRoleRowCount(Role role);

    public List<Role> findRoleByPage(@Param("page") Page page,@Param("role") Role role);

    //根据名称和code查询角色是否存在
    public int selectRoleByNameOrCode(String roleName,String roleCode);

    //增加新角色
    public int insertRole(Role role);

//    更新角色状态
    public int updateRoleState(Integer roleId,String roleState);

//    删除角色
    public int deleteRoleByRoleId(Integer roleId);

//    修改角色
    public int updateRoleDescByRoleId(Role role);

    //根据角色id查询角色所有权限(菜单)的方法
    public List<Integer> selectAuthIdListByRoleId(int roleId);

//    根据roleId删除角色-权限记录
    public int deleteRoleAuthByRoleId(Integer roleId);
//    添加角色权限
    public int insertRoleAuth(Integer roleId,Integer authId);
}
